<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"  lang="en">
<head>
  <script type="text/javascript" th:src="@{/static/layui-v2.6.13/layui/layui.js}"></script>
  <script type="text/javascript" th:src="@{/static/js/jquery-1.9.1.min.js}"></script>
  <meta charset="utf-8">
  <title>插入页</title>
</head>
  <body>
  <form class="layui-form">
    <input type="text" name="name" >
    <input type="text" name="password">
    <button onclick="ins()" type="button">创建</button>
  </form>
  </body>
  <script>
	layui.use('layer',function(){
		var layer = layui.layer;
	});
	function ins(){
		var form = $("form").serialize();
		$.ajax({
			url:'insert',
			type:'post',
			data:form,
			success:function(obj){
				var index = parent.layer.getFrameIndex(window.name);
				parent.layer.close(index);
			}
		});
	}
</script>
</html>

















